import { $get } from '@js/authRequest'
import moment from 'moment'

export async function getData (year) {
  const b = moment(`${year}-01-01 00:00:00`)
  const begintime = Math.floor(b.valueOf() / 1000)
  const e = b.add(1, 'year').subtract(1, 'second')
  const endtime = Math.floor(e.valueOf() / 1000)
  const res = await $get('/api/mgt/institutionstat/desktop', {
    begintime,
    endtime
  })
  return res.data
}
